/*
 * This source code is part of TWaver 4.0
 *
 * Serva Software PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * Copyright 2002 - 2011 Serva Software. All rights reserved.
 */

package demo.network.miscellaneous.map;

import java.awt.Color;

import twaver.ShapeNode;
import twaver.TWaverConst;

public class MapNode extends ShapeNode {
	private int attachmentDirection = TWaverConst.ATTACHMENT_DIRECTION_TOP_RIGHT;

	public MapNode() {
		super();
		initStates();
	}

	public MapNode(Object id) {
		super(id);
		initStates();
	}

	public void initStates() {
		this.putBorderVisible(false);
		this.setShapeNodeType(TWaverConst.SHAPENODE_CLOSE_STRAIGHT_LINE);
		this.putCustomDrawFill(true);
		this.putCustomDrawOutline3D(false);
		this.putCustomDrawFillColor(new Color(0, 100, 150, 200));
		this.putCustomDrawOutlineStroke(TWaverConst.STROKE_SOLID_1);
		this.putCustomDrawGradient(false);
		this.putCustomDrawOutlineColor(new Color(250, 240, 200));
		this.putLabelPosition(TWaverConst.POSITION_CENTER);
		this.putLabelColor(Color.GREEN);
		this.putLabelHighlightable(false);
		this.putShapeNodeShowDashLine(false);
	}

	public int getAttachmentDirection() {
		return attachmentDirection;
	}

	public void setAttachmentDirection(int attachmentDirection) {
		if (this.attachmentDirection != attachmentDirection) {
			int oldValue = this.attachmentDirection;
			this.attachmentDirection = attachmentDirection;
			this.firePropertyChange("attachmentDirection", oldValue, attachmentDirection);
		}
	}
}